.class Lcom/waiqin365/lightapp/im/adapter/bg;
.super Ljava/lang/Object;

# interfaces
.implements Lcom/squareup/picasso/Transformation;


# instance fields
.field final synthetic a:Lcom/waiqin365/lightapp/im/domain/IMPhoto;

.field final synthetic b:Luk/co/senab/photoview/PhotoView;

.field final synthetic c:Lcom/waiqin365/lightapp/im/adapter/bd;


# direct methods
.method constructor <init>(Lcom/waiqin365/lightapp/im/adapter/bd;Lcom/waiqin365/lightapp/im/domain/IMPhoto;Luk/co/senab/photoview/PhotoView;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/lightapp/im/adapter/bg;->c:Lcom/waiqin365/lightapp/im/adapter/bd;

    iput-object p2, p0, Lcom/waiqin365/lightapp/im/adapter/bg;->a:Lcom/waiqin365/lightapp/im/domain/IMPhoto;

    iput-object p3, p0, Lcom/waiqin365/lightapp/im/adapter/bg;->b:Luk/co/senab/photoview/PhotoView;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public key()Ljava/lang/String;
    .locals 1

    const-string/jumbo v0, "transformation desiredWidth"

    return-object v0
.end method

.method public transform(Landroid/graphics/Bitmap;)Landroid/graphics/Bitmap;
    .locals 6

    const/16 v1, 0x64

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bg;->a:Lcom/waiqin365/lightapp/im/domain/IMPhoto;

    iget-object v0, v0, Lcom/waiqin365/lightapp/im/domain/IMPhoto;->c:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_2

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bg;->a:Lcom/waiqin365/lightapp/im/domain/IMPhoto;

    iget-object v0, v0, Lcom/waiqin365/lightapp/im/domain/IMPhoto;->c:Ljava/lang/String;

    invoke-static {p1, v1, v0}, Lcom/waiqin365/compons/camera/b/a;->a(Landroid/graphics/Bitmap;ILjava/lang/String;)Z

    :cond_0
    :goto_0
    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bg;->b:Luk/co/senab/photoview/PhotoView;

    invoke-virtual {v0}, Luk/co/senab/photoview/PhotoView;->getWidth()I

    move-result v0

    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v1

    int-to-double v2, v1

    invoke-virtual {p1}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v1

    int-to-double v4, v1

    div-double/2addr v2, v4

    int-to-double v4, v0

    mul-double/2addr v2, v4

    double-to-int v1, v2

    const/4 v2, 0x0

    invoke-static {p1, v0, v1, v2}, Landroid/graphics/Bitmap;->createScaledBitmap(Landroid/graphics/Bitmap;IIZ)Landroid/graphics/Bitmap;

    move-result-object v0

    if-eq v0, p1, :cond_1

    if-eqz p1, :cond_1

    invoke-virtual {p1}, Landroid/graphics/Bitmap;->recycle()V

    :cond_1
    return-object v0

    :cond_2
    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bg;->a:Lcom/waiqin365/lightapp/im/domain/IMPhoto;

    iget-object v0, v0, Lcom/waiqin365/lightapp/im/domain/IMPhoto;->b:Ljava/lang/String;

    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/waiqin365/lightapp/im/adapter/bg;->a:Lcom/waiqin365/lightapp/im/domain/IMPhoto;

    iget-object v0, v0, Lcom/waiqin365/lightapp/im/domain/IMPhoto;->b:Ljava/lang/String;

    invoke-static {p1, v1, v0}, Lcom/waiqin365/compons/camera/b/a;->a(Landroid/graphics/Bitmap;ILjava/lang/String;)Z

    goto :goto_0
.end method
